From: Florian Müllner Date: Fri, 13 Aug 2021 01:02:05 +0000 (+0200) Subject: appDisplay: Fix dead error handling X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~574^2^2~129 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=941419e165d60c0a95d4e73310f4f88b1a03a5d3;p=gnome-shell.git appDisplay: Fix dead error handling gjs includes an override to turn GSettings' asserts into exceptions, but we'll have to catch that instead of checking for a null return value. Spotted by coverity in CID 351268. Part-of: --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 012e88bd0..3673c8541 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -1831,11 +1831,13 @@ class AppDisplay extends BaseAppView { // Create the new folder let newFolderPath = this._folderSettings.path.concat('folders/', newFolderId, '/'); - let newFolderSettings = new Gio.Settings({ - schema_id: 'org.gnome.desktop.app-folders.folder', - path: newFolderPath, - }); - if (!newFolderSettings) { + let newFolderSettings; + try { + newFolderSettings = new Gio.Settings({ + schema_id: 'org.gnome.desktop.app-folders.folder', + path: newFolderPath, + }); + } catch (e) { log('Error creating new folder'); return false; }